package com.doge;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;

public class Launcher extends Game implements com.badlogic.gdx.ApplicationListener
{

	private Stage stage;
	
	Skin skin;
	
	TextButton gameButton;
	TextButton editorButton;
	
	InputListener gameListener;
	InputListener editorListener;
	
	@Override
	public void create() 
	{
		stage = new Stage();
		Gdx.input.setInputProcessor(stage);
		skin = new Skin(Gdx.files.internal("./bin/data/uiskin.json"));
		
		Table mainTable = new Table();
		mainTable.center();
		mainTable.setFillParent(true);
		
		gameButton = new TextButton("Game",skin);
		editorButton = new TextButton("Editor",skin);
		
		gameButton.addListener(gameListener);
		editorButton.addListener(editorListener);
		
		mainTable.add(gameButton);
		mainTable.add(editorButton);
		stage.addActor(mainTable);

		
	}

	@Override
	public void resize(int width, int height) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void render() {
		Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		stage.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30f));
		stage.draw();
		
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

}
